-- 计算升级技能的消耗

return function(who, skillId)
    local cost = SkillM.query(skillId, "upgrade_cost")
    local clsssId
    local amount
    
    if who.type == OBJECT_TYPE_PET then
        -- 宠物，消耗魂石
        classId = PetM.query(who.classId, "soul")
        amount  = cost["soul"]
    elseif who.type == OBJECT_TYPE_USER then
        -- 玩家，消耗物品
        classId = cost["item"][1]
        amount  = cost["item"][2]
    else
        -- 其他类型暂不支持
        return
    end
        
    return {
        { 1, classId, amount or 0, },
        { 2, "money", cost["money"] or 0, },
    }
end
